# -*- coding: utf-8 -*-
# @Time    : 2024/2/1 20:36
# @Author  : micah
# @File    : 3.使用selenium获取浏览器渲染完毕的页面源代码.py
# @Software: PyCharm

import time
from selenium import webdriver
from lxml import etree


browser = webdriver.Chrome()
browser.get('https://careers.aliyun.com/off-campus/position-list?lang=zh')

time.sleep(2)

# 获取渲染完成的页面源代码
tree = etree.HTML(browser.page_source)
positions = tree.xpath("//div[@class='_1RRlPtjyYmeDGCWt9lrk2P _3vj2eS7k7Mwpko5_6OSRu2']/text()")
print(positions)

browser.close()
